package com.snbc.smcp.pipeline;

import cn.hutool.json.JSONUtil;
import com.github.artbits.quickio.api.Collection;
import com.github.artbits.quickio.api.DB;
import com.github.artbits.quickio.api.KV;
import com.github.artbits.quickio.api.Tin;
import com.github.artbits.quickio.core.Config;
import com.github.artbits.quickio.core.IOEntity;
import com.github.artbits.quickio.core.QuickIO;
import com.github.artbits.quickio.struct.Document;

import java.io.File;
import java.util.Optional;

/**
 * 类描述:   https://github.com/artbits/quickio .
 *
 * @author xuping
 * 创建时间:  [2023/10/16 19:21]
 */
public class QuickioTest2 {

    public static void main(String[] args) {

        Config config =Config.of(config1 -> {
            config1.path("/Users/pingxu/temp/data/");
            config1.name("zuaa1");
            config1.cache(10000L);
        });
        ZuaaUser zuaaUser = new ZuaaUser();
        zuaaUser.setName("zuaa");

        KV kv = QuickIO.usingKV(config);
        kv.write("Pi", zuaaUser);

        ZuaaUser s = kv.read("Pi", ZuaaUser.class);
        QuickIO.println("%s  ", s );
        kv.close();
    }
}
